package org.example.dic.core.form;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@ApiModel(value="新增字典类型form")
public class InsertDicTypeForm implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotNull(message = "父级id不能为空")
    @ApiModelProperty(value = "父级id",required = true,example = "0")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long parentId;

    @NotNull(message = "分组key不能为空")
    @ApiModelProperty(value = "分组key",required = true,example = "1")
    private String groupKey;

    @NotNull(message = "类型key不能为空")
    @ApiModelProperty(value = "类型key",required = true)
    private String typeKey;

    @NotNull(message = "类型名称不能为空")
    @ApiModelProperty(value = "类型名称",required = true)
    private String typeName;

    @NotNull(message = "序号不能为空")
    @ApiModelProperty(value = "序号",required = true,example = "1")
    private Integer sortNum;
}
